#include<stdio.h>
#include<unistd.h>
#include<signal.h>

struct sigaction oldact;

void sigcallback(int sig){
    printf("sigcallback recv sig num:%d\n",sig);
//    sigaction(2,&oldact,NULL);
}

int main(){
    struct sigaction sig;
    sig.sa_handler=sigcallback;

    sigaction(SIGINT,&sig,&oldact);

    while(1){
        printf("i am action\n");
        sleep(1);
    }
    return 0;
}

